<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>编辑商品</title>
  </head>
   <script>
	  function productAdd_submit(obj){
	  	$("input[name='productVO.customerVO.id']").val($("#customerId").val());
	  	return validateCallback(obj, navTabAjaxDone);
	  }
  </script>
  <body>
	<div class="pageContent">
		<form method="post" action="<%=path %>/product/saveProduct.action" class="pageForm required-validate" onsubmit="return productAdd_submit(this);">
			<div class="pageFormContent" layoutH="56">
				<p>
					<label>商品编码：</label>
					<input name="productVO.code" value="<s:property value="productVO.code" />" class="required" type="text" size="30" alt="请输入商品编码"/>
				</p>
				<p>
					<label>商品名称：</label>
					<input name="productVO.name" value="<s:property value="productVO.name" />" class="required" type="text" size="30" alt="请输入商品名称"/>
				</p>
				<p>
					<label>商品价格：</label>
					<input name="productVO.price" value="<s:property value="productVO.price" />" class="required" type="text" size="30" alt="请输入商品价格"/>
				</p>
				<p>
					<label>商品积分：</label>
					<input name="productVO.point" value="<s:property value="productVO.point" />" class="required" type="text" size="30" alt="请输入商品积分"/>
				</p>
				<div class="divider" style="border:0;"></div>
						<dl class="nowrap">
							<dt>备注：</dt>
							<dd>
							<textarea class="textInput" rows="2" cols="80" name="productVO.remark" style="width: 510px; height: 80px;"><s:property value="productVO.remark" /></textarea>
							</dd>
						</dl>
				<div class="divider" style="border:0;"></div>
						<dl class="nowrap">
							<dt>描述：</dt>
							<dd>
							<textarea class="textInput" rows="2" cols="80" name="productVO.description" style="width: 510px; height: 80px;"><s:property value="productVO.description" /></textarea>
							</dd>
						</dl>
				<p>
					<label>所属商家：</label>
					<input id="customerId" name="customerId" value="${SESSION_USER.customer==null?'':(SESSION_USER.customer.id)}" type="hidden" size="30"/>
					<input name="productVO.customerVO.id" value="${SESSION_USER.customer==null?'':(SESSION_USER.customer.id)}" type="hidden">
					<input id="customerName" name="customerName" value="${SESSION_USER.customer==null?'':(SESSION_USER.customer.name)}" readonly>
					<c:if test="${SESSION_USER.customer==null}">
						<a class="btnLook" href="<%=path %>/customer/listCustomer.action?searchType=product&lookUpPre=add" lookupGroup="">选择</a>
					</c:if>
				</p>
				<p>
					<label>商品分类：</label>
					<select name="productVO.productKindVO.id" id="add_productKind">
							<option value="-1">请选择</option>
	              	</select>
				</p>
			</div>
			<div class="formBar">
				<ul>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li>
						<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
					</li>
				</ul>
			</div>
		</form>
	</div>
  </body>
</html>